<?php
/**
 * Eren Framework
 * 
 * AutoLoads Class
 * 
 * @category System
 * @author Manu Soros Leu
 * @copyright manusoros@gmail.com
 */

function __autoload($className)
{
    $fileName = str_replace('_', '/', $className) . '.php';
    $appFile = PROJECT_PATH . 'Application/' . $fileName;
    $sysFile = PROJECT_PATH . 'Library/' . $fileName;
    if(file_exists($appFile))
    {
        require_once $appFile;
    }
    else if(file_exists($sysFile))
    {
        require_once $sysFile;
    }
}